import store from '@/store'
export default {
  methods: {
    // key是按钮的的权限标识
    checkPermission(key) {
      const {
        userInfo: {
          roles: {
            points
          }
        }
      } = store.state.user
      if (points && points.length) {
        // 只要在数组中就返回true
        return points.some(item => item === key)
      }
      return false
    }
  }
}
